package com.panghl.controller;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.panghl.mapper.PayOrderMapper;
import com.panghl.model.entity.PayOrder;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author xiaokuixiao
 * date2024/7/25 14:59
 */

@RestController
@RequestMapping("/payOrder")
public class PayOrderController {

    @Resource
    private PayOrderMapper payOrderMapper;

    @PostMapping("/insert")
    public String  insert(@RequestBody PayOrder  payOrder) {
        payOrderMapper.insert(payOrder);
      return "ok";
    }
    @GetMapping("/list")
    public List<PayOrder> list(){
       return payOrderMapper.selectList(null);
    }
    @PostMapping("/inject")
    public PayOrder getInject(@RequestBody PayOrder  payOrder) {
        return    payOrderMapper.selectOne(new QueryWrapper<PayOrder>().eq("order_id", payOrder.getOrderId()));
    }
}
